load("//bazel:defs.bzl", "compatible_with_pico_w", "incompatible_with_config")

package(default_visibility = ["//visibility:public"])

# Prefer these aliases to directly referencing @btstack, as it's possible that
# name may change.
alias(
    name = "pico_btstack_base",
    actual = "@btstack//:pico_btstack_base",
)

alias(
    name = "pico_btstack_ble",
    actual = "@btstack//:pico_btstack_ble",
)

alias(
    name = "pico_btstack_classic",
    actual = "@btstack//:pico_btstack_classic",
)

alias(
    name = "pico_btstack_sbc_encoder",
    actual = "@btstack//:pico_btstack_classic",
)

alias(
    name = "pico_btstack_bnep_lwip",
    actual = "@btstack//:pico_btstack_bnep_lwip",
)

alias(
    name = "pico_btstack_bnep_lwip_sys_freertos",
    actual = "@btstack//:pico_btstack_bnep_lwip_sys_freertos",
)

cc_library(
    name = "pico_btstack_flash_bank",
    srcs = ["btstack_flash_bank.c"],
    hdrs = ["include/pico/btstack_flash_bank.h"],
    includes = ["include"],
    target_compatible_with = compatible_with_pico_w(),
    deps = [
        ":pico_btstack_base",
        "//src/rp2_common:pico_platform",
        "//src/rp2_common/pico_flash",
    ],
)

cc_library(
    name = "btstack_run_loop_async_context",
    srcs = ["btstack_run_loop_async_context.c"],
    hdrs = ["include/pico/btstack_run_loop_async_context.h"],
    includes = ["include"],
    target_compatible_with = compatible_with_pico_w(),
    deps = [
        "//src/rp2_common/hardware_sync",
        "//src/rp2_common/pico_async_context",
        "@btstack//:pico_btstack_base",
    ],
)

cc_library(
    name = "pico_btstack_stdin",
    srcs = ["btstack_stdin_pico.c"],
    target_compatible_with = incompatible_with_config(
        "//bazel/constraint:pico_btstack_config_unset",
    ) + compatible_with_pico_w(),
    deps = [
        "//src/rp2_common:pico_platform",
        "//src/rp2_common/pico_stdio",
    ],
)
